// src/components/AdminPanel.jsx
import React from "react";
import { useSelector } from "react-redux";

const AdminPanel = () => {
  const role = useSelector((state) => state.user.role);

  if (role !== "admin") {
    return <div>无权限访问该页面</div>;
  }

  return <div>欢迎管理员，您可以进行相关操作。</div>;
};

export default AdminPanel;
